package com.utils.ylt;

import java.util.UUID;
 public class PkeyGenerator 
    {

        private PkeyGenerator()
        {
        }

        public static synchronized String getUniqueString()
        {
            if(generateCount > 999)
                generateCount = 0;
            String uniqueNumber = Long.toString(System.currentTimeMillis()) + Integer.toString(generateCount);
            generateCount++;
            return uniqueNumber;
        }
        /**
         * UUID去"-"的字符串
         * @return 总长度为32的字符串
         */
        public static String getUUIDString(){
        	return UUID.randomUUID().toString().replaceAll("-", "");
        }

        private static final int MAX_GENERATE_COUNT = 999;
        private static int generateCount = 0;
        
        
        public static void main(String[] args){
        	for(int i=0;i<10000;i++){
        		System.out.println(PkeyGenerator.getUniqueString());
        	}
        }

    } 